<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>

    </style>
</head>
<body>
    <div>
        <input type="text" name="hyb" value="何彦博" />
        <input type="text" name="hyb" value="15" /><br />
        <input type="button" value="传参" id="transFun" onclick=chuancan() />
   </div>
</body>
</html>
<script>
     function  chuancan(){
                var arr = document.getElementsByName("hyb");
                for(var i=0;i<arr.length;i++){
                    alert(arr[i].value);                    
                }
            }
</script>